{/include file="simpla/common/header.html"/}
{/include file="simpla/common/left.html"/}
<div id="main-content">
    <h2>欢迎您 {/$_adminname/}</h2>
    <p id="page-intro">查看和管理所有已有的商品。</p>
    <div class="clear"></div>
    <div class="content-box">
      <div class="content-box-header">
        <h3>商品管理</h3>
        <ul class="content-box-tabs">
            <li><a href="#tab1" class="default-tab">商品管理</a></li>
            <li><a href="{/get_url rule="/goods/addgoods"/}">添加商品</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
        <div class="form">
          <form action="{/get_url rule='/goods/index'/}" method="post" id="js-form">
            <fieldset>
                  <p><select id="one" name="cat_id">
                    <option value="0">-----选择分类-----</option>
                    {/section name=i loop=$catelist/}
                    <option value="{/$catelist[i].cat_id/}" {/if $catelist[i].cat_id eq $cat_id/}selected="selected"{//if/}>{/$catelist[i].pre/}{/$catelist[i].cat_name/}</option>
                    {//section/}
                    </select>&nbsp;关键字：<input type="text" value="{/$key/}" class="text-input small-input" name="key" />
                    <span>（商品名称，条形码）<input type="submit" name="" id="button" class="button" value="查询" /></span></p>
            </fieldset>
          </form>
        </div>
        <hr />
          <table>
            <thead>
              <tr>
                <th>商品条形码</th>
                <th>商品名称</th>
                <th>所属分类</th>
                <th>售价(元)</th>
                <th>促销价(元)</th>
                <th>市场价(元)</th>
                <th>库存</th>
                <th>库存总额(元)</th>
                <th>销售总额(元)</th>
                <th>管理</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">{/$pagebar/}</td>
              </tr>
            </tfoot>
            <tbody>
                {/section name=i loop=$goods/}
                <tr>
                  <td>{/$goods[i].goods_sn/}</td>
                  <td>{/$goods[i].goods_name/}</td>
                  <td>{/$goods[i].cat_name/}</td>
                  <td><span class="red fb">{/$goods[i].out_price/}</span></td>
                  <td>{/if $goods[i].ispromote eq 1/}{/$goods[i].promote_price/}{/else/}未促销{//if/}</td>
                  <td>{/$goods[i].market_price/}</td>
                  <td>{/if $goods[i].stock gt $goods[i].warn_stock/}{/$goods[i].stock/}{/else/}<span class="red fb" title="低于最小库存">{/$goods[i].stock/}(缺)</span>{//if/}</td>  
                  <td><span class="red">{/$goods[i].countamount/}</span></td>
                  <td><span class="red">{/$goods[i].salesamount/}</span></td>
                  <td><a href="{/get_url rule='/goods/addgoods' data='gid='|cat:$goods[i].goods_id/}" title="编辑"><img src="{/$root_dir/}/assets/simpla/images/icons/pencil.png" alt="编辑" /></a>&nbsp;<a href="{/get_url rule='/purchase/purchase' data='gid='|cat:$goods[i].goods_id/}" title="入库"><img src="{/$root_dir/}/assets/simpla/images/icons/hammer_screwdriver.png" alt="入库" /></a></td>
                </tr>
                {//section/}
            </tbody>
          </table>
        </div>
      </div>
    </div>
    {/include file="simpla/common/copy.html"/}
  </div>
{/include file="simpla/common/footer.html"/}